Feature: Book Genie Mode - Automated Testing with Detailed Reporting
File name: BookGenie.feature
Relative path: features/BookGenie.feature
Scenario Outline: Book Genie Response Validation with Citation Verification
Error: No book data extracted from BookGenie response.
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:46:15)
at /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:8:71
at __awaiter (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:4:12)
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:59:12)
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification === [12:52:17 AM] Navigating to Creative Workspace login page [12:52:20 AM] Homepage visibility: false [12:52:20 AM] ℹ️ Typing query: "Suggest 5 books on christmas" [12:52:20 AM] ℹ️ Preparing to type query: "Suggest 5 books on christmas" [12:52:20 AM] ℹ️ Waiting for chat input to be visible [12:52:22 AM] ℹ️ Clearing chat input [12:52:22 AM] ℹ️ Typing query: "Suggest 5 books on christmas" [12:52:23 AM] ℹ️ Pressing Enter to submit query [12:52:24 AM] ✅ Query submitted successfully: "Suggest 5 books on christmas" [12:52:24 AM] ℹ️ Waiting for AI to complete thinking... [12:52:24 AM] 📋 WAITING FOR AI RESPONSE [12:52:24 AM] ℹ️ Looking for AI thinking indicator... [12:52:24 AM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes) [12:52:25 AM] ✅ ✓ AI thinking indicator appeared - AI is processing the request [12:52:25 AM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes) [12:52:27 AM] ✅ ✓ AI thinking completed - Response should be ready [12:52:27 AM] ℹ️ Allowing additional time for response rendering [12:52:30 AM] ✅ AI response wait process completed [12:52:30 AM] ℹ️ Validating response for query: "Suggest 5 books on christmas" [12:52:30 AM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 5 books on christmas" [12:52:30 AM] ℹ️ Locating the latest response in chat [12:52:30 AM] ℹ️ Waiting for response to be visible (max 30 seconds) [12:52:30 AM] ✅ Response received - Length: 608 characters [12:52:30 AM] ℹ️ Response preview: Watch Me WorkInterpreting context for your query...That sounds like a lovely theme! To help you find... [12:52:30 AM] ℹ️ Extracting book data from response... [12:52:30 AM] 📋 EXTRACTING BOOK DATA FROM RESPONSE [12:52:30 AM] ℹ️ Locating BookGenie response container [12:52:30 AM] ℹ️ Extracting HTML content from response [12:52:30 AM] ℹ️ HTML content extracted - Length: 7560 characters [12:52:30 AM] ℹ️ Parsing HTML to extract book data [12:52:30 AM] ✅ SUCCESSFULLY EXTRACTED 0 BOOKS [12:52:30 AM] 📋 EXTRACTED BOOKS SUMMARY [12:52:30 AM] 📊 Total books extracted: 0 [12:52:30 AM] 📊 Average relevance score: 0% [12:52:30 AM] ✅ Extracted 0 books from response === END LOGS ===
Scenario Logs: Book Genie Response Validation with Citation Verification
Scenario Outline: Book Genie Response Validation with Citation Verification
CITATION VALIDATION DETAILED REPORT ================================================================================ BOOK: The Art of Talking with Children ------------------------------------------------------------ ✅ Reason 1: PASS (100%) ✅ Reason 2: PASS (95%) ✅ Reason 3: PASS (95%) BOOK: A Christmas Carol ------------------------------------------------------------ ✅ Reason 1: PASS (95%) ✅ Reason 2: PASS (100%) ❌ Reason 3: FAIL (0%) 📝 Reason: The book is targeted towards an audience with an interest age from 6 to 10... 📚 Citation: Interest age, years: from 6 to 10... ⚠️ Citation text not found in reason: "Interest age, years: from 6 to 10" BOOK: A Series of Unfortunate Events #1: The Bad Beginning ------------------------------------------------------------ ✅ Reason 1: PASS (100%) ❌ Reason 2: FAIL (0%) 📝 Reason: It is targeted towards an audience with an interest age from 8 to 12... 📚 Citation: Interest age, years: from 8 to 12... ⚠️ Citation text not found in reason: "Interest age, years: from 8 to 12" ❌ Reason 3: FAIL (0%) 📝 Reason: The book is categorized under JUVENILE FICTION: Family / Orphans & Foster Homes... 📚 Citation: JUVENILE FICTION: Family / Orphans & Foster Homes... ⚠️ Citation text not found in reason: "JUVENILE FICTION: Family / Orphans & Foster Homes" SUMMARY: 6/9 reasons passed (66.7%) OVERALL STATUS: FAIL
Citation validation failed: 6/9 passed (66.7%)
Citation Validation Summary: 6/9 passed
📊 Citation Validation Report
Generated on 10/15/2025, 12:54:25 AM
📖 The Art of Talking with Children
📖 A Christmas Carol
📖 A Series of Unfortunate Events #1: The Bad Beginning
📈 Validation Summary
PER-BOOK AI VALIDATION REPORT - Query: "Suggest 3 books for childrens"
================================================================================
OVERALL RELEVANCE SCORE: 70%
STATUS: FAIL
BOOKS ANALYZED: 3
BOOK 1: "The Art of Talking with Children"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 2: "A Christmas Carol"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 3: "A Series of Unfortunate Events #1: The Bad Beginning"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
SUMMARY FEEDBACK:
----------------------------------------
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 27.461717976s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"27s"}]
OVERALL IMPROVEMENT SUGGESTIONS:
----------------------------------------
• Retry the analysis when Gemini API is less busy
• Consider running tests during off-peak hours
• Check Google AI status page for service updates
🤖 PER-BOOK AI Response Relevance Validation
Query: "Suggest 3 books for childrens"
Overall Relevance Score: 70%
Status: FAIL
Books Analyzed: 3
Individual Book Analyses
📖 Book 1: "The Art of Talking with Children" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 2: "A Christmas Carol" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 3: "A Series of Unfortunate Events #1: The Bad Beginning" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
Summary Feedback
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. * Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2 Please retry in 27.461717976s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"27s"}]
Overall Improvement Suggestions
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification ===
[12:52:32 AM] Navigating to Creative Workspace login page
[12:52:34 AM] Homepage visibility: false
[12:52:34 AM] ℹ️ Typing query: "Suggest 3 books for childrens"
[12:52:34 AM] ℹ️ Preparing to type query: "Suggest 3 books for childrens"
[12:52:34 AM] ℹ️ Waiting for chat input to be visible
[12:52:36 AM] ℹ️ Clearing chat input
[12:52:36 AM] ℹ️ Typing query: "Suggest 3 books for childrens"
[12:52:37 AM] ℹ️ Pressing Enter to submit query
[12:52:37 AM] ✅ Query submitted successfully: "Suggest 3 books for childrens"
[12:52:37 AM] ℹ️ Waiting for AI to complete thinking...
[12:52:37 AM] 📋 WAITING FOR AI RESPONSE
[12:52:37 AM] ℹ️ Looking for AI thinking indicator...
[12:52:37 AM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes)
[12:52:39 AM] ✅ ✓ AI thinking indicator appeared - AI is processing the request
[12:52:39 AM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes)
[12:52:50 AM] ✅ ✓ AI thinking completed - Response should be ready
[12:52:50 AM] ℹ️ Allowing additional time for response rendering
[12:52:53 AM] ✅ AI response wait process completed
[12:52:53 AM] ℹ️ Validating response for query: "Suggest 3 books for childrens"
[12:52:53 AM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 3 books for childrens"
[12:52:53 AM] ℹ️ Locating the latest response in chat
[12:52:53 AM] ℹ️ Waiting for response to be visible (max 30 seconds)
[12:52:53 AM] ✅ Response received - Length: 2259 characters
[12:52:53 AM] ℹ️ Response preview: Watch Me WorkRetrieving Relevant Books for 'books for children' in Book Summary ...Retrieving Releva...
[12:52:53 AM] ℹ️ Extracting book data from response...
[12:52:53 AM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[12:52:53 AM] ℹ️ Locating BookGenie response container
[12:52:53 AM] ℹ️ Extracting HTML content from response
[12:52:53 AM] ℹ️ HTML content extracted - Length: 27087 characters
[12:52:53 AM] ℹ️ Parsing HTML to extract book data
[12:52:53 AM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[12:52:53 AM] 📋 EXTRACTED BOOKS SUMMARY
[12:52:53 AM] 📚 1. "The Art of Talking with Children" - Score: 100%%
[12:52:53 AM] 📚 2. "A Christmas Carol" - Score: 100%%
[12:52:53 AM] 📚 3. "A Series of Unfortunate Events #1: The Bad Beginning" - Score: 100%%
[12:52:53 AM] 📊 Total books extracted: 3
[12:52:53 AM] 📊 Average relevance score: 100%
[12:52:53 AM] ✅ Extracted 3 books from response
[12:52:53 AM] ℹ️ Saving 3 books to Excel file: test_results/suggest_3_books_for_childrens.xlsx
[12:52:53 AM] 📋 SAVING BOOKS TO EXCEL FILE
[12:52:53 AM] ℹ️ Target file path: test_results/suggest_3_books_for_childrens.xlsx
[12:52:53 AM] ℹ️ Exporting 3 books to Excel format
[12:52:53 AM] ✅ Book data saved to: test_results/suggest_3_books_for_childrens.xlsx
[12:52:53 AM] 📊 File verified - Size: 16.88 KB
[12:52:53 AM] ✅ ✓ Excel file creation verified successfully
[12:52:53 AM] 📋 STARTING INDIVIDUAL BOOK VALIDATION (3 books) for query: "Suggest 3 books for childrens"
[12:52:53 AM] 📋 📚 VALIDATING BOOK 1: "The Art of Talking with Children"
[12:52:53 AM] ℹ️ Starting comprehensive book validation
[12:52:53 AM] ℹ️ Validating title: "The Art of Talking with Children" vs expected: "The Art of Talking with Children"
[12:52:53 AM] ✅ ✅ TITLE VALIDATION PASSED: "The Art of Talking with Children"
[12:52:53 AM] ℹ️ Validating score: 100% vs expected: 100%
[12:52:53 AM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[12:52:53 AM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[12:52:53 AM] ℹ️ Why-match points: extracted 3 vs expected 3
[12:52:53 AM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[12:52:53 AM] ✅ 🎉 BOOK 1 VALIDATION: ALL CHECKS PASSED!
[12:52:53 AM] ℹ️ Book 1 validation completed
[12:52:53 AM] 📋 📚 VALIDATING BOOK 2: "A Christmas Carol"
[12:52:53 AM] ℹ️ Starting comprehensive book validation
[12:52:53 AM] ℹ️ Validating title: "A Christmas Carol" vs expected: "A Christmas Carol"
[12:52:53 AM] ✅ ✅ TITLE VALIDATION PASSED: "A Christmas Carol"
[12:52:53 AM] ℹ️ Validating score: 100% vs expected: 100%
[12:52:53 AM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[12:52:53 AM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[12:52:53 AM] ℹ️ Why-match points: extracted 3 vs expected 3
[12:52:53 AM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[12:52:53 AM] ✅ 🎉 BOOK 2 VALIDATION: ALL CHECKS PASSED!
[12:52:53 AM] ℹ️ Book 2 validation completed
[12:52:53 AM] 📋 📚 VALIDATING BOOK 3: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:52:53 AM] ℹ️ Starting comprehensive book validation
[12:52:53 AM] ℹ️ Validating title: "A Series of Unfortunate Events #1: The Bad Beginning" vs expected: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:52:53 AM] ✅ ✅ TITLE VALIDATION PASSED: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:52:53 AM] ℹ️ Validating score: 100% vs expected: 100%
[12:52:53 AM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[12:52:53 AM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[12:52:53 AM] ℹ️ Why-match points: extracted 3 vs expected 3
[12:52:53 AM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[12:52:53 AM] ✅ 🎉 BOOK 3 VALIDATION: ALL CHECKS PASSED!
[12:52:53 AM] ℹ️ Book 3 validation completed
[12:52:53 AM] 📊 VALIDATION SUMMARY: 3/3 books passed
[12:52:53 AM] ✅ ALL BOOKS VALIDATED SUCCESSFULLY!
[12:52:53 AM] 📋 🔍 VALIDATING REASON-CITATION MATCHES
[12:52:53 AM] ℹ️ Starting citation validation process...
[12:52:53 AM] 📋 🚀 STARTING COMPLETE CITATION VALIDATION WORKFLOW
[12:52:53 AM] ℹ️ Step 1: Extracting books from AI response
[12:52:53 AM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[12:52:53 AM] ℹ️ Locating BookGenie response container
[12:52:53 AM] ℹ️ Extracting HTML content from response
[12:52:53 AM] ℹ️ HTML content extracted - Length: 27087 characters
[12:52:53 AM] ℹ️ Parsing HTML to extract book data
[12:52:53 AM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[12:52:53 AM] 📋 EXTRACTED BOOKS SUMMARY
[12:52:53 AM] 📚 1. "The Art of Talking with Children" - Score: 100%%
[12:52:53 AM] 📚 2. "A Christmas Carol" - Score: 100%%
[12:52:53 AM] 📚 3. "A Series of Unfortunate Events #1: The Bad Beginning" - Score: 100%%
[12:52:53 AM] 📊 Total books extracted: 3
[12:52:53 AM] 📊 Average relevance score: 100%
[12:52:53 AM] ℹ️ Step 2: Extracting citation texts from book elements
[12:52:53 AM] 📋 📚 EXTRACTING CITATION TEXTS FROM BOOK ELEMENTS
[12:52:53 AM] ℹ️ Step 1: Waiting for main book section
[12:52:53 AM] ℹ️ Found 7 total accordion sections
[12:52:53 AM] ℹ️ Found individual book: "1. The Art of Talking with Children"
[12:52:53 AM] ℹ️ Found individual book: "2. A Christmas Carol"
[12:52:53 AM] ℹ️ Found individual book: "3. A Series of Unfortunate Events #1: The Bad Beginning"
[12:52:53 AM] ℹ️ Processing 3 individual book sections
[12:52:53 AM] 📋 📖 PROCESSING BOOK 1: "The Art of Talking with Children"
[12:52:53 AM] ℹ️ Expanding book section: "The Art of Talking with Children"
[12:52:56 AM] ✅ Book section expanded: "The Art of Talking with Children"
[12:52:56 AM] ℹ️ Expanding "Why this book is the match" section for: "The Art of Talking with Children"
[12:52:59 AM] ✅ "Why this book is the match" section expanded for: "The Art of Talking with Children"
[12:52:59 AM] ℹ️ Found 3 citation buttons for "The Art of Talking with Children"
[12:52:59 AM] ℹ️ Extracting citation 1/3 for "The Art of Talking with Children"
[12:52:59 AM] ℹ️ Processing metadata citation 1 for "The Art of Talking with Children"
[12:53:00 AM] ℹ️ Clicking to OPEN metadata citation 1
[12:53:02 AM] ℹ️ Extracted citation text (first 100 chars): practical tools...
[12:53:02 AM] ℹ️ Clicking to CLOSE metadata citation 1
[12:53:04 AM] ✅ ✅ metadata citation 1 closed successfully
[12:53:04 AM] ℹ️ ✅ Citation 1 extracted successfully (length: 15)
[12:53:04 AM] ℹ️ Extracting citation 2/3 for "The Art of Talking with Children"
[12:53:04 AM] ℹ️ Processing manuscript citation 2 for "The Art of Talking with Children"
[12:53:05 AM] ℹ️ Clicking to OPEN manuscript citation 2
[12:53:07 AM] ℹ️ Extracted citation text (first 100 chars): The book champions 'rich talk' as a transformative parenting philosophy, cultivating compassionate, ...
[12:53:07 AM] ℹ️ Clicking to CLOSE manuscript citation 2
[12:53:08 AM] ✅ ✅ manuscript citation 2 closed successfully
[12:53:08 AM] ℹ️ ✅ Citation 2 extracted successfully (length: 130)
[12:53:08 AM] ℹ️ Extracting citation 3/3 for "The Art of Talking with Children"
[12:53:08 AM] ℹ️ Processing manuscript citation 3 for "The Art of Talking with Children"
[12:53:09 AM] ℹ️ Clicking to OPEN manuscript citation 3
[12:53:11 AM] ℹ️ Extracted citation text (first 100 chars): identified as a FIRST EDITION, with its digital version released in March 2022...
[12:53:11 AM] ℹ️ Clicking to CLOSE manuscript citation 3
[12:53:13 AM] ✅ ✅ manuscript citation 3 closed successfully
[12:53:13 AM] ℹ️ ✅ Citation 3 extracted successfully (length: 78)
[12:53:13 AM] ℹ️ Collapsing book section: "The Art of Talking with Children"
[12:53:14 AM] ✅ Book section collapsed: "The Art of Talking with Children"
[12:53:14 AM] ✅ ✅ Completed processing "The Art of Talking with Children" - 3 citations extracted
[12:53:14 AM] 📋 📖 PROCESSING BOOK 2: "A Christmas Carol"
[12:53:14 AM] ℹ️ Expanding book section: "A Christmas Carol"
[12:53:17 AM] ✅ Book section expanded: "A Christmas Carol"
[12:53:17 AM] ℹ️ Expanding "Why this book is the match" section for: "A Christmas Carol"
[12:53:20 AM] ✅ "Why this book is the match" section expanded for: "A Christmas Carol"
[12:53:20 AM] ℹ️ Found 3 citation buttons for "A Christmas Carol"
[12:53:20 AM] ℹ️ Extracting citation 1/3 for "A Christmas Carol"
[12:53:20 AM] ℹ️ Processing metadata citation 1 for "A Christmas Carol"
[12:53:21 AM] ℹ️ Clicking to OPEN metadata citation 1
[12:53:24 AM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Classics...
[12:53:24 AM] ℹ️ Clicking to CLOSE metadata citation 1
[12:53:25 AM] ✅ ✅ metadata citation 1 closed successfully
[12:53:25 AM] ℹ️ ✅ Citation 1 extracted successfully (length: 26)
[12:53:25 AM] ℹ️ Extracting citation 2/3 for "A Christmas Carol"
[12:53:25 AM] ℹ️ Processing metadata citation 2 for "A Christmas Carol"
[12:53:26 AM] ℹ️ Clicking to OPEN metadata citation 2
[12:53:28 AM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Classics...
[12:53:28 AM] ℹ️ Clicking to CLOSE metadata citation 2
[12:53:30 AM] ✅ ✅ metadata citation 2 closed successfully
[12:53:30 AM] ℹ️ ✅ Citation 2 extracted successfully (length: 26)
[12:53:30 AM] ℹ️ Extracting citation 3/3 for "A Christmas Carol"
[12:53:30 AM] ℹ️ Processing metadata citation 3 for "A Christmas Carol"
[12:53:31 AM] ℹ️ Clicking to OPEN metadata citation 3
[12:53:33 AM] ℹ️ Extracted citation text (first 100 chars): Interest age, years: from 6 to 10...
[12:53:33 AM] ℹ️ Clicking to CLOSE metadata citation 3
[12:53:34 AM] ✅ ✅ metadata citation 3 closed successfully
[12:53:34 AM] ℹ️ ✅ Citation 3 extracted successfully (length: 33)
[12:53:34 AM] ℹ️ Collapsing book section: "A Christmas Carol"
[12:53:36 AM] ✅ Book section collapsed: "A Christmas Carol"
[12:53:36 AM] ✅ ✅ Completed processing "A Christmas Carol" - 3 citations extracted
[12:53:36 AM] 📋 📖 PROCESSING BOOK 3: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:36 AM] ℹ️ Expanding book section: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:39 AM] ✅ Book section expanded: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:39 AM] ℹ️ Expanding "Why this book is the match" section for: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:42 AM] ✅ "Why this book is the match" section expanded for: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:42 AM] ℹ️ Found 3 citation buttons for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:42 AM] ℹ️ Extracting citation 1/3 for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:42 AM] ℹ️ Processing metadata citation 1 for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:43 AM] ℹ️ Clicking to OPEN metadata citation 1
[12:53:45 AM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION...
[12:53:45 AM] ℹ️ Clicking to CLOSE metadata citation 1
[12:53:47 AM] ✅ ✅ metadata citation 1 closed successfully
[12:53:47 AM] ℹ️ ✅ Citation 1 extracted successfully (length: 16)
[12:53:47 AM] ℹ️ Extracting citation 2/3 for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:47 AM] ℹ️ Processing metadata citation 2 for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:48 AM] ℹ️ Clicking to OPEN metadata citation 2
[12:53:50 AM] ℹ️ Extracted citation text (first 100 chars): Interest age, years: from 8 to 12...
[12:53:50 AM] ℹ️ Clicking to CLOSE metadata citation 2
[12:53:51 AM] ✅ ✅ metadata citation 2 closed successfully
[12:53:51 AM] ℹ️ ✅ Citation 2 extracted successfully (length: 33)
[12:53:51 AM] ℹ️ Extracting citation 3/3 for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:51 AM] ℹ️ Processing metadata citation 3 for "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:52 AM] ℹ️ Clicking to OPEN metadata citation 3
[12:53:54 AM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Family / Orphans & Foster Homes...
[12:53:54 AM] ℹ️ Clicking to CLOSE metadata citation 3
[12:53:56 AM] ✅ ✅ metadata citation 3 closed successfully
[12:53:56 AM] ℹ️ ✅ Citation 3 extracted successfully (length: 49)
[12:53:56 AM] ℹ️ Collapsing book section: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:57 AM] ✅ Book section collapsed: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:53:57 AM] ✅ ✅ Completed processing "A Series of Unfortunate Events #1: The Bad Beginning" - 3 citations extracted
[12:53:57 AM] ✅ 🎉 Successfully extracted citations from 3 books
[12:53:57 AM] ℹ️ Step 3: Validating reason-citation matches
[12:53:57 AM] 📋 🔍 VALIDATING REASON-CITATION MATCHES (80% THRESHOLD)
[12:53:57 AM] ℹ️ 📖 Validating 3 reasons for: "The Art of Talking with Children"
[12:53:57 AM] ℹ️ Reason 1: Checking match...
[12:53:57 AM] ✅ ✅ "The Art of Talking with Children" - Reason 1: 100% match - PASS
[12:53:57 AM] ℹ️ Reason 2: Checking match...
[12:54:03 AM] ✅ ✅ "The Art of Talking with Children" - Reason 2: 95% match - PASS
[12:54:03 AM] ℹ️ Reason 3: Checking match...
[12:54:15 AM] ✅ ✅ "The Art of Talking with Children" - Reason 3: 95% match - PASS
[12:54:15 AM] ℹ️ 📖 Validating 3 reasons for: "A Christmas Carol"
[12:54:15 AM] ℹ️ Reason 1: Checking match...
[12:54:25 AM] ✅ ✅ "A Christmas Carol" - Reason 1: 95% match - PASS
[12:54:25 AM] ℹ️ Reason 2: Checking match...
[12:54:25 AM] ✅ ✅ "A Christmas Carol" - Reason 2: 100% match - PASS
[12:54:25 AM] ℹ️ Reason 3: Checking match...
[12:54:25 AM] ❌ ❌ "A Christmas Carol" - Reason 3: 0% match - FAIL
[12:54:25 AM] ❌ ⚠️ Citation text not found in reason: "Interest age, years: from 6 to 10"
[12:54:25 AM] ℹ️ 📖 Validating 3 reasons for: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:54:25 AM] ℹ️ Reason 1: Checking match...
[12:54:25 AM] ✅ ✅ "A Series of Unfortunate Events #1: The Bad Beginning" - Reason 1: 100% match - PASS
[12:54:25 AM] ℹ️ Reason 2: Checking match...
[12:54:25 AM] ❌ ❌ "A Series of Unfortunate Events #1: The Bad Beginning" - Reason 2: 0% match - FAIL
[12:54:25 AM] ❌ ⚠️ Citation text not found in reason: "Interest age, years: from 8 to 12"
[12:54:25 AM] ℹ️ Reason 3: Checking match...
[12:54:25 AM] ❌ ❌ "A Series of Unfortunate Events #1: The Bad Beginning" - Reason 3: 0% match - FAIL
[12:54:25 AM] ❌ ⚠️ Citation text not found in reason: "JUVENILE FICTION: Family / Orphans & Foster Homes"
[12:54:25 AM] 📊 📊 CITATION VALIDATION SUMMARY: 6/9 passed (66.7%)
[12:54:25 AM] ❌ 💥 REASON-CITATION VALIDATION: OVERALL FAILED
[12:54:25 AM] ℹ️ Step 4: Generating detailed report
[12:54:25 AM] 📋 📋 GENERATING CITATION VALIDATION REPORT
[12:54:25 AM] ℹ️ Report generated: 6/9 reasons passed
[12:54:25 AM] ✅ ✅ Citation validation workflow completed successfully
[12:54:25 AM] 📊 📈 OVERALL CITATION VALIDATION: 6/9 (66.7%)
[12:54:25 AM] ❌ ❌ REASON-CITATION VALIDATION: OVERALL FAILED - Only 66.7% of reasons match citations (required: 80%)
[12:54:25 AM] 📋 📋 GENERATING DETAILED CITATION VALIDATION REPORT
[12:54:25 AM] ℹ️ Generating HTML citation validation report
[12:54:25 AM] ✅ Generated HTML report for 9 reasons
[12:54:25 AM] ✅ ✅ Citation validation HTML report generated and attached
[12:54:25 AM] ✅ ✅ Citation validation plain text report attached
[12:54:25 AM] ℹ️ Checking database connectivity...
[12:54:25 AM] ✅ ✅ Database connected successfully
[12:54:25 AM] ℹ️ Database path: /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/test_data/database.xlsx
[12:54:25 AM] ℹ️ Total books: 10032
[12:54:25 AM] 📊 Database contains 10032 books
[12:54:25 AM] ✅ ✅ Database book count requirement met: 10032 >= 2020
[12:54:25 AM] 📋 🔍 VALIDATING EXTRACTED BOOKS INDIVIDUALLY AGAINST DATABASE
[12:54:25 AM] ℹ️ Checking book 1/3: "The Art of Talking with Children"
[12:54:25 AM] ℹ️ Checking if book exists in database: "The Art of Talking with Children"
[12:54:26 AM] ✅ ✅ Database match: "The Art of Talking with Children" → "He"
[12:54:26 AM] ℹ️ Checking book 2/3: "A Christmas Carol"
[12:54:26 AM] ℹ️ Checking if book exists in database: "A Christmas Carol"
[12:54:26 AM] ✅ ✅ Database match: "A Christmas Carol" → "A Christmas Carol"
[12:54:26 AM] ℹ️ Checking book 3/3: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:54:26 AM] ℹ️ Checking if book exists in database: "A Series of Unfortunate Events #1: The Bad Beginning"
[12:54:26 AM] ✅ ✅ Database match: "A Series of Unfortunate Events #1: The Bad Beginning" → "Eve"
[12:54:26 AM] 📊 INDIVIDUAL DATABASE VALIDATION SUMMARY: 3/3 books found in database
[12:54:26 AM] ✅ 🎉 ALL BOOKS VALIDATED SUCCESSFULLY AGAINST DATABASE!
[12:54:26 AM] 📋 🤖 VALIDATING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[12:54:26 AM] ℹ️ Starting Gemini AI per-book relevance validation...
[12:54:26 AM] 📋 🤖 ANALYZING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[12:54:26 AM] ℹ️ Starting Gemini AI analysis with retry logic...
[12:54:32 AM] ⚠ ⚠️ GEMINI VALIDATION: Using fallback analysis due to API issues
[12:54:32 AM] ℹ️ Overall Score: 70% (Fallback)
[12:54:32 AM] 📋 📖 ANALYSIS FOR: "The Art of Talking with Children" - Score: 70%
[12:54:32 AM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ 💡 Book-specific improvements:
[12:54:32 AM] ℹ️ - Retry analysis when service is available
[12:54:32 AM] 📋 📖 ANALYSIS FOR: "A Christmas Carol" - Score: 70%
[12:54:32 AM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ 💡 Book-specific improvements:
[12:54:32 AM] ℹ️ - Retry analysis when service is available
[12:54:32 AM] 📋 📖 ANALYSIS FOR: "A Series of Unfortunate Events #1: The Bad Beginning" - Score: 70%
[12:54:32 AM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[12:54:32 AM] ℹ️ 💡 Book-specific improvements:
[12:54:32 AM] ℹ️ - Retry analysis when service is available
[12:54:32 AM] ℹ️ 📊 SUMMARY FEEDBACK:
[12:54:32 AM] ℹ️ • AI analysis service is temporarily overloaded
[12:54:32 AM] ℹ️ • Using fallback analysis with neutral scores
[12:54:32 AM] ℹ️ • Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 27.461717976s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"27s"}]
[12:54:32 AM] ❌ ❌ GEMINI AI VALIDATION FAILED: 70% relevance score (required: 80%)
[12:54:32 AM] ℹ️ Continuing execution due to soft assertion...
=== END LOGS ===